package com.desksoft.action;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.desksoft.common.UUIDGenerator;
import com.desksoft.entity.Reply;
import com.desksoft.service.ReplyService;

/**
 * 回复contoller
 * @author forever
 *
 */
@Controller
@RequestMapping(value="/page/reply")
public class ReplyController extends BaseController{

	@Autowired
	private ReplyService replyService;
	
	@RequestMapping(value="/insert",method=RequestMethod.POST)
	@ResponseBody
	public Object insertReply(HttpServletRequest request,Reply reply){
		reply.setReplyId(UUIDGenerator.get());
		reply.setUserId("0000");
		try{
			replyService.insertReply(reply);
		}catch (Exception e) {
			return this.failMessage();
		}
		return this.successMessage();
	}
}
